<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <title>Global Image - Detalhe da folha de pagamento</title>
            <link rel="stylesheet" type="text/css" href="/globalimage2/faces/jsfcrud.css" /><%@ include file="/WEB-INF/jspf/AjaxScripts.jspf" %><script type="text/javascript" src="/globalimage2/faces/jsfcrud.js"></script>
        </head>
        <body>
            <%@include file="../../WEB-INF/jspf/header/head.jspf"%>
            <div style="float:left">
                <%@include file="../../WEB-INF/jspf/header/menuDinamico.jspf"%>
            </div>
            <div id="div_content">
                <div class="bgContentTable">
                    <div class="titleTable"><h3>Detalhe da folha de pagamento</h3></div><br />
                    <h:form>

                        &nbsp;&nbsp;<h:commandLink action="#{folhaPagamento.createSetup}" value="Novo" />
                        &nbsp;|&nbsp;
                        <h:commandLink action="#{folhaPagamento.editSetup}" value="Editar">
                            <f:param name="jsfcrud.currentFolhaPagamento" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][folhaPagamento.folhaPagamento][folhaPagamento.converter].jsfcrud_invoke}" />
                        </h:commandLink>
                        &nbsp;|&nbsp;
                        <h:commandLink action="#{folhaPagamento.listSetup}" value="Exibir todos"/>

                        <h:panelGroup id="messagePanel" layout="block">
                            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                        </h:panelGroup>
                        <br />
                        <h:panelGrid columns="2">
                            <h:outputText value="Funcionário:"/>
                            <h:commandLink value="#{folhaPagamento.folhaPagamento.funcionarioId}" action="#{funcionario.detailSetup}">
                                <f:param name="jsfcrud.currentFuncionario" value="#{jsfcrud_class['entidade.controller.JSF.util.JsfUtil'].jsfcrud_method['getAsConvertedString'][folhaPagamento.folhaPagamento.funcionarioId][funcionario.converter].jsfcrud_invoke}"/>
                            </h:commandLink>
                            <h:outputText value="Data do pagamento:"/>
                            <h:outputText value="#{folhaPagamento.folhaPagamento.dataPagamento}" title="DataPagamento" >
                                <f:convertDateTime pattern="dd/ MM/ yyyy" />
                            </h:outputText>
                            <h:outputText value="Salário atual:"/>
                            <h:outputText value="#{folhaPagamento.folhaPagamento.salario}" title="Salario" >
                                <f:convertNumber type="currency"/>
                            </h:outputText>
                            <h:outputText value="Adiantamento:"/>
                            <h:outputText value="#{folhaPagamento.folhaPagamento.adiantamento}" title="Adiantamento" >
                                <f:convertNumber type="currency"/>
                            </h:outputText>
                            <h:outputText value="Extra:"/>
                            <h:outputText value="#{folhaPagamento.folhaPagamento.extra}" title="Extra" >
                                <f:convertNumber type="currency"/>
                            </h:outputText>
                            <h:outputText value="Total:"/>
                            <h:outputText value="#{folhaPagamento.folhaPagamento.extra + folhaPagamento.folhaPagamento.salario}" >
                                <f:convertNumber type="currency"/>
                            </h:outputText>
                            <h:outputText value="Pagamentos Efetuados:"/>
                            <h:panelGroup>
                                <h:outputText rendered="#{empty folhaPagamento.folhaPagamento.entradaSaidaCollection}" value="(No Items)"/>
                                <h:dataTable value="#{folhaPagamento.folhaPagamento.entradaSaidaCollection}" var="item"
                                             border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"
                                             rendered="#{not empty folhaPagamento.folhaPagamento.entradaSaidaCollection}">
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Data do vencimento"/>
                                        </f:facet>
                                        <h:outputText value="#{item.dataVencimento}">
                                            <f:convertDateTime pattern="dd/ MM/ yyyy" />
                                        </h:outputText>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Valor"/>
                                        </f:facet>
                                        <h:outputText value="#{item.valor}">
                                            <f:convertNumber type="currency"/>
                                        </h:outputText>
                                    </h:column>
                                </h:dataTable>
                            </h:panelGroup>
                        </h:panelGrid>

                    </h:form>
                </div>
            </div>
        </body>
    </html>
</f:view>
